#include <stdio.h>
#include <queue>
using namespace std;
const int p = 998244353;
int f[6][6][6][6][6][2], vis[6][6][6][6][6][2], n, m;
struct node
{
    int i1, i2, i3, i4, i5, ci;
} now;
queue<node> q;
int main()
{
    freopen("drama.in","r",stdin);
    freopen("drama.out","w",stdout);
    scanf("%d%d", &n, &m);
    f[1][2][3][4][5][0] = 1;
    q.push({1, 2, 3, 4, 5, 0});
    while (!q.empty())
    {
        now = q.front();
        q.pop();
        if (now.ci == m)
        {
            break;
        }
        if (n >= 2)
            f[now.i1][now.i2][now.i3][now.i5][now.i4][(now.ci & 1) ^ 1] = (f[now.i1][now.i2][now.i3][now.i5][now.i4][(now.ci & 1) ^ 1] + f[now.i1][now.i2][now.i3][now.i4][now.i5][now.ci & 1]) % p;
        if (n >= 3)
            f[now.i1][now.i2][now.i5][now.i3][now.i4][(now.ci & 1) ^ 1] = (f[now.i1][now.i2][now.i5][now.i3][now.i4][(now.ci & 1) ^ 1] + f[now.i1][now.i2][now.i3][now.i4][now.i5][now.ci & 1]) % p;
        if (n >= 4)
            f[now.i1][now.i5][now.i2][now.i3][now.i4][(now.ci & 1) ^ 1] = (f[now.i1][now.i5][now.i2][now.i3][now.i4][(now.ci & 1) ^ 1] + f[now.i1][now.i2][now.i3][now.i4][now.i5][now.ci & 1]) % p;
        if (n >= 5)
            f[now.i5][now.i1][now.i2][now.i3][now.i4][(now.ci & 1) ^ 1] = (f[now.i5][now.i1][now.i2][now.i3][now.i4][(now.ci & 1) ^ 1] + f[now.i1][now.i2][now.i3][now.i4][now.i5][now.ci & 1]) % p;
        f[now.i1][now.i2][now.i3][now.i4][now.i5][(now.ci & 1) ^ 1] = (f[now.i1][now.i2][now.i3][now.i4][now.i5][(now.ci & 1) ^ 1] + f[now.i1][now.i2][now.i3][now.i4][now.i5][now.ci & 1]) % p;
        f[now.i1][now.i2][now.i3][now.i4][now.i5][now.ci & 1] = 0;
        vis[now.i1][now.i2][now.i3][now.i4][now.i5][now.ci & 1] = 0;
        // printf("%d %d %d %d\n",f[now.i1][now.i2][now.i3][now.i5][now.i4][(now.ci&1)^1],now.ci+1,now.i5,now.i4);
        // printf("%d %d %d %d\n",f[now.i1][now.i2][now.i3][now.i4][now.i5][(now.ci&1)^1],now.ci+1,now.i4,now.i5);
        // printf("%d %d\n\n",f[now.i1][now.i2][now.i3][now.i4][now.i5][now.ci&1],(now.ci&1)^1);
        if (!vis[now.i1][now.i2][now.i3][now.i4][now.i5][(now.ci & 1) ^ 1])
        {
            vis[now.i1][now.i2][now.i3][now.i4][now.i5][(now.ci & 1) ^ 1] = 1;
            q.push({now.i1, now.i2, now.i3, now.i4, now.i5, now.ci + 1});
        }
        if (n >= 2 and !vis[now.i1][now.i2][now.i3][now.i5][now.i4][(now.ci & 1) ^ 1])
        {
            vis[now.i1][now.i2][now.i3][now.i5][now.i4][(now.ci & 1) ^ 1] = 1;
            q.push({now.i1, now.i2, now.i3, now.i5, now.i4, now.ci + 1});
        }
        if (n >= 3 and !vis[now.i1][now.i2][now.i5][now.i3][now.i4][(now.ci & 1) ^ 1])
        {
            vis[now.i1][now.i2][now.i5][now.i3][now.i4][(now.ci & 1) ^ 1] = 1;
            q.push({now.i1, now.i2, now.i5, now.i3, now.i4, now.ci + 1});
        }
        if (n >= 4 and !vis[now.i1][now.i5][now.i2][now.i3][now.i4][(now.ci & 1) ^ 1])
        {
            vis[now.i1][now.i5][now.i2][now.i3][now.i4][(now.ci & 1) ^ 1] = 1;
            q.push({now.i1, now.i5, now.i2, now.i3, now.i4, now.ci + 1});
        }
        if (n >= 5 and !vis[now.i5][now.i1][now.i2][now.i3][now.i4][(now.ci & 1) ^ 1])
        {
            vis[now.i5][now.i1][now.i2][now.i3][now.i4][(now.ci & 1) ^ 1] = 1;
            q.push({now.i5, now.i1, now.i2, now.i3, now.i4, now.ci + 1});
        }
    }
    printf("%d", f[1][2][3][4][5][m & 1]);
    return 0;
}